package cloud.xlh.domin.vo;

/**
 * Created with IntelliJ IDEA.
 *
 * @ project name : xlh_osms
 * @ Author: XuLeHuang
 * @ Date: 2023/1/8 18:51
 * @ Description:
 */
public class CommonRspVO<T extends BaseVO> {
    private String retCode;
    private String retInfo;
    private T data;
    public Builder<T> builder = new Builder<T>();

    public String getRetCode() {
        return retCode;
    }

    public void setRetCode(String retCode) {
        this.retCode = retCode;
    }

    public String getRetInfo() {
        return retInfo;
    }

    public void setRetInfo(String retInfo) {
        this.retInfo = retInfo;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public class Builder<T extends BaseVO> {
        private String retCode;
        private String retInfo;
        private T data;

        public String getRetCode() {
            return retCode;
        }

        public Builder<T> retCode(String retCode) {
            this.retCode = retCode;
            return this;
        }

        public String getRetInfo() {
            return retInfo;
        }

        public Builder<T> retInfo(String retInfo) {
            this.retInfo = retInfo;
            return this;
        }

        public T getData() {
            return data;
        }

        public Builder<T> data(T data) {
            this.data = data;
            return this;
        }

        public CommonRspVO build() {
            CommonRspVO commonRspVO = new CommonRspVO();
            commonRspVO.setRetCode(this.retCode);
            commonRspVO.setRetInfo(this.retInfo);
            commonRspVO.setData(this.data);
            return commonRspVO;
        }
    }
}
